import request from "@/utils/request";
/*****************  字典类型管理  *******************/
// 列表
export function dictTypeList(params) {
  return request({
    url: "/dict-type",
    headers: {
      isToken: false,
    },
    method: "get",
    params,
  });
}
// 新增
export function dictTypeAdd(params) {
  return request({
    url: "/dict-type/add",
    headers: {
      isToken: false,
    },
    method: "post",
    data: params,
  });
}
// 修改
export function dictTypeEdit(id: number, params) {
  return request({
    url: `/dict-type/${id}`,
    headers: {
      isToken: false,
    },
    method: "patch",
    data: params,
  });
}
// 删除
export function dictTypeDel(params) {
  return request({
    url: `/dict-type/delete`,
    headers: {
      isToken: false,
    },
    method: "post",
    data: params
  });
}
// 详情
export function dictTypeInfo(id) {
  return request({
    url: `/dict-type/${id}`,
    headers: {
      isToken: false,
    },
    method: "get",
  });
}

// 导出
export function dictTypeExport() {
  return request({
    url: `/dict-type/excel`,
    headers: {
      isToken: false,
    },
    method: "post",
    responseType: "blob",
  });
}

/*****************  字典数据管理  *******************/
// 列表
export function dictDataList(params) {
  return request({
    url: "/dict-data",
    headers: {
      isToken: false,
    },
    method: "get",
    params,
  });
}

// 新增
export function dictDataAdd(params) {
  return request({
    url: "/dict-data/add",
    headers: {
      isToken: false,
    },
    method: "post",
    data: params,
  });
}

// 修改
export function dictDataEdit(id: number, params) {
  return request({
    url: `/dict-data/${id}`,
    headers: {
      isToken: false,
    },
    method: "patch",
    data: params,
  });
}

// 删除
export function dictDataDel(params) {
  return request({
    url: `/dict-data/delete`,
    headers: {
      isToken: false,
    },
    method: "post",
    data: params
  });
}

// 详情
export function dictDataInfo(id) {
  return request({
    url: `/dict-data/${id}`,
    headers: {
      isToken: false,
    },
    method: "get",
  });
}

// 导出
export function dictDataExport() {
  return request({
    url: `/dict-data/excel`,
    headers: {
      isToken: false,
    },
    method: "post",
    responseType: "blob",
  });
}